package com.woniu.command.repaircommand;

import com.woniu.command.Command;
import com.woniu.command.handler.RepairAppCommandHandler;
import com.woniu.util.ApplicationContextHolder;

public class ProductedCommand implements Command<Integer> {

    private RepairAppCommandHandler handler;

    public ProductedCommand (){
        //ApplicationContextHolder.getApplicationContext()拿到ApplicationContext
        this.handler= ApplicationContextHolder.getApplicationContext()
                .getBean(RepairAppCommandHandler.class);
    }

    @Override
    public void execute (Integer id) {
        handler.producted(id);
    }
}
